<%@page import="java.util.ArrayList"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<%@page import="models.Domain"%>
<%
Domain domain = (Domain) request.getAttribute("domain"); 
String name = (String) request.getAttribute("name");
String title = "Check Whois online";
String des = "This test will return WHOIS registration results for a DOMAIN name. Depending on the registrar, you can see various information like who is it registered to, when it was registered and when it expires";
String key = "whois, lookup whois,whois tool";
if(name!=null)
{
	title = "Whois "+name;
	des= title+" ,This test will return WHOIS registration results for ."+name;
	key=name+",whois, lookup whois,whois tool";
}
Cache caches=null;
try {
    caches = CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());
} catch (CacheException e) {
   e.printStackTrace();
   
}
ArrayList<String> view = null;
if(caches.containsKey("view"))
{
	view = (ArrayList<String>) caches.get("view");
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><%=title %></title>
<meta name="description" content="<%=des %>" />
<meta name="keywords" content="<%=key %>" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<style type="text/css">
<!--
a:link {
	color: #3183B2;
}

a:visited {
	color: #3183B2;
}

a:hover {
	color: #000000;
}

a:active {
	color: #333333;
}
#whois-reginfo .def{
width: 150px;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	color: #5F5F5F;
}

h1 {
	color: 666666;
}

h2 {
	color: 666666;
}

h3 {
	color: 666666;
}

h4 {
	color: 666666;
}

h5 {
	color: 666666;
}

h6 {
	color: 666666;
}
-->
</style>
</head>
<body>
	<br />
	<br />
	<br />
	<p align="center">
		<a href="/" title="whois"><img
			src="/images/logo.png" alt="whois Tool Online" border="0">
		</a>

	</p>
	<center>
		<form name="related" method="get" action="/search">
			<table width="615" BORDER="0" align="center" CELLPADDING="2"
				class=normal id="table1">
				<tr>
					<th width="71%" scope="col" abbr="Keyword Synonyms Tool"><div
							align="left">
							<p>
								<input name="name" type="text" id="domain" value="<%=name!=null?name:"google.com" %>"
									size="60" maxlength="99"
									onclick="document.related.domain.value ='';"> 
									
								<input type="submit" name="Submit"
									value="Whois">	
								<span
									class="alt">  <br> Use gulfvoices to Lookup whois a Domain<br>
								</span>
							</p>
						</div>
					</th>
				</tr>
			</table>
		</form>
	</center>
	
	<table width="745" align="center">
		<%
		if(name!=null)
		{
		%>
		<tr>
			<td colspan="2"><h1>Whois <%=name %></h1></td>
		</tr>
		<tr>
			<td colspan="2"><%=domain.getWhois()!=null?domain.getWhois().getValue():"No whois" %></td>
		</tr>
		<tr>
			<td colspan="2"><h2>Review <a target="_blank" href="http://www.lizbon.org/site/<%=name%>"><%=name%></a> on lizbon.org</h2></td>
		</tr>
		
		<%
		if(!domain.getOtherDomain().equals(""))
		{
		%>
		<tr>
			<td width="150">Other domain</td>
			<td>
				<%
					String[] oth = domain.getOtherDomain().split(",");
					for(int i=0;i<oth.length;i++)
					{
						out.print("<a href=\"/whois/"+oth[i]+"\">"+oth[i]+"</a>, ");
					}
				%>
			</td>
		</tr>
		<%
		}
		%>
		
		<%
		} else {
		%>
		<tr>
			<td colspan='2'>This test will return WHOIS registration results for a DOMAIN name. Depending on the registrar, you can see various information like who is it registered to, when it was registered and when it expires, where the DNS is hosted, and more. In some cases, you will be able to go the registrar's site to get more information. </td>
		</tr>
		<tr>
			<td width="150"><h4>Recent site view</h4></td>
			<td>
				<%
				if(view!=null)
				{
					for(int j=0;j<view.size();j++)
					{
					%>
						<a href="/whois/<%=view.get(j) %>"><%=view.get(j) %></a>, 
					<%
						if(j==18)
							break;
					}
				}
				%>
			</td>
		</tr>
		<%
		}
		%>
	</table>
	<br />

	<br />
	<br />
	<p align="center">
		<a href="/">&copy; 2012 gulfvoices.org</a> | 
		<a href='http://www.lizbon.org' target='_blank'>review domain</a> | 
		<a href='http://www.ontar.net' target='_blank'>check dns</a> |
		<a class="addthis_button"
			href="http://www.addthis.com/bookmark.php?v=250&amp;pub=ra-4d6f3cdb1d190d60"><img
			src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125"
			height="16" alt="Bookmark and Share" style="border: 0" />
		</a>
		<script type="text/javascript"
			src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4abc324b311cfb79"></script>
	</p>

	<center></center>
</body>
</html>